<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>登录管理平台</title>
    <link href="<?php echo DWZ_URL; ?>themes/css/login.css" rel="stylesheet" type="text/css" />
    <script src="<?php echo SITE_URL . 'theme/js/v1/jquery-1.8.3.min.js'; ?>" type="text/javascript"></script>
    <link rel="shortcut icon" href="favicon.ico" />
</head>

<body>
<div id="login">
    <div id="login_header">
        <h1 class="login_logo">
            <a href="###"><img src="<?php echo SITE_URL; ?>theme/image/v1/logo.png" /></a>
        </h1>
        <div class="login_headerContent">
            <div class="navList">
                <ul>
                    <li><a href="javascript:;" id="addHomePage">设为首页</a></li>
                    <li><a href="javascript:alert('开发中……');" target="_blank">帮助</a></li>
                </ul>
            </div>
            <h2 class="login_title"><img src="<?php echo DWZ_URL; ?>themes/default/images/login_title.png" /></h2>
        </div>
    </div>
    <div id="login_content">
        <div class="loginForm">
            <form id="login_form" method="post" action="<?php echo SITE_URL; ?>index.php?c=user&a=login">
                <p>
                    <label>用户名：</label>
                    <input type="text" name="account" size="20" class="login_input" value=""/>
                </p>
                <p>
                    <label>密码：</label>
                    <input type="password" name="password" size="20" class="login_input" value=""/>
                </p>
                <p>
                    <label>验证码：</label>
                    <input class="code" type="text" name="verify" size="4" value="ABCD"/><!--width="75" height="24"-->
                    <span><img id="img_verify" style="cursor: pointer"  src="<?php echo SITE_URL.'verify.php'; ?>" alt="刷新验证码" /></span>
                </p>
                <div class="login_bar">
                    <input class="sub" type="submit" name="submit" value=""  style="margin-left: 10px"/>
                </div>
                <p style="color: red;vertical-align:middle; text-align: center;display: none" class="_tips">登录异常请刷新后重试！</p>
            </form>
        </div>
        <div class="login_banner"><img src="<?php echo DWZ_URL; ?>themes/default/images/login_banner.jpg" /></div>
        <div class="login_main">
            <ul class="helpList">
                <li><a href="#">注册账号</a></li>
                <li><a href="#">忘记密码怎么办？</a></li>
                <li><a href="#">为什么登录失败？</a></li>
            </ul>
            <div class="login_inner">
                <p>您可以在此基础上随意扩展你的业务需求</p>
                <p>如 记事本 知识小百科 ……。</p>
            </div>
        </div>
    </div>
    <div id="login_footer">
        Copyright &copy; <?php echo date('Y') == 2013 ? 2013 : 2013 . '-' .date('Y'); ?> www.whoopsfeed.com Inc. All Rights Reserved.
    </div>
</div>

<script type="text/javascript">

    $(document).ready(function () {
        //添加到收藏夹
        $("#addHomePage").click(function () {

            if (document.all) {
                document.body.style.behavior = 'url(#default#homepage)';
                document.body.setHomePage(window.location.href);
            }else if (window.sidebar) {

                if (window.netscape) {

                    try {
                        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
                    }
                    catch (e) {
                        alert("该操作被浏览器拒绝，如果想启用该功能，请在地址栏内输入 about:config,然后将项 signed.applets.codebase_principal_support 值该为true 或 自己手动设置");

                        history.go(-1);
                    }

                }

                var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);

                prefs.setCharPref('browser.startup.homepage', window.location.href);
            }
        });

        $('#img_verify').click(function(){
            this.src='<?php echo SITE_URL; ?>verify.php?t='+Math.random();
        });

        function loginTip(text){
            $('._tips').text(text);
            $('._tips').fadeIn('slow');
            $('._tips').fadeOut('slow');
        }

        //$('input').val('');
        $('input[name="account"]').focus();

        $('#login_form').submit(function(){

            fel = $('input[name="account"]');
            if($.trim(fel.val()) == ''){
                loginTip('登录账号不能为空');
                fel.focus();
                return false;
            }

            fel = $('input[name="password"]');
            if($.trim(fel.val()) == ''){
                loginTip('密码不能为空！');
                fel.focus();
                return false;
            }

            fel = $('input[name="verify"]');
            if($.trim(fel.val()) == ''){
                loginTip('验证码不能为空！');
                fel.focus();
                return false;
            }
        });
    });

</script>
</body>
</html>